#pragma once
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

#ifdef COCO
#include "libcoco.h"
#define CROUT_STRUCT	crout_t
#define CROUT_ATTR	crout_attr_t
#define CROUT_CREATE	crout_create
#define CROUT_YIELD	crout_yield
#define CROUT_RESUME	crout_resume
#define CROUT_RELEASE	crout_release
#define CROUT_RESET	crout_reset
#else
#include "co_routine.h"
#define CROUT_STRUCT	struct stCoRoutine_t
#define CROUT_ATTR	struct stCoRoutineAttr_t
#define CROUT_CREATE	co_create
#define CROUT_YIELD	co_yield
#define CROUT_RESUME	co_resume
#define CROUT_RELEASE	co_release
#define CROUT_RESET	co_reset
#endif

#include <compl.h>
#include <dbg.h>
#include <dbg/ptest.h>

SAI void stack_used(size_t sz){
	void *ptr = alloca(sz);
	for(word_t idx = 0; idx < sz ; idx += sizeof(word_t)){
		*(volatile word_t *)((word_t)ptr + idx) = 0xAA5555AADEADBEEF;
	}
}
#define MAX_STACKSIZE	(8192)
#define MIN_STACKSIZE	(4096) /* 注意redzone,*/
